
#include "GPIO10.h"

uint8_t f=0;

void GPIO10_Init(){

 
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO|RCC_APB2Periph_GPIOC,ENABLE);
    
    GPIO_InitTypeDef GPIO_Struct;
    
    EXTI_InitTypeDef EXTI_Struct;
    
    NVIC_InitTypeDef NVIC_Struct;
    
    
    GPIO_Struct.GPIO_Pin=GPIO_Pin_10;
    GPIO_Struct.GPIO_Mode=GPIO_Mode_IN_FLOATING;
    GPIO_Struct.GPIO_Speed=GPIO_Speed_50MHz;
    
    GPIO_Init(GPIOC,&GPIO_Struct);

    GPIO_EXTILineConfig(GPIO_PortSourceGPIOC,GPIO_PinSource10);
    
    EXTI_Struct.EXTI_Line=EXTI_Line10;
    EXTI_Struct.EXTI_Mode=EXTI_Mode_Interrupt;
    EXTI_Struct.EXTI_Trigger=EXTI_Trigger_Falling;
    EXTI_Struct.EXTI_LineCmd=ENABLE;
      
    EXTI_Init(&EXTI_Struct); 
    
    
    NVIC_Struct.NVIC_IRQChannel=EXTI15_10_IRQn;
    NVIC_Struct.NVIC_IRQChannelPreemptionPriority=3;
    NVIC_Struct.NVIC_IRQChannelSubPriority=2;
    NVIC_Struct.NVIC_IRQChannelCmd=ENABLE;
        
    NVIC_Init(&NVIC_Struct);



}



void EXTI15_10_IRQHandler(void){

  if(EXTI_GetITStatus(EXTI_Line10)!=RESET){
     
     f++;

     EXTI_ClearITPendingBit(EXTI_Line10);

  }

  





}
